/*
 * 创建日期 2005-10-8
 *
 * 更改所生成文件模板为
 * 窗口 > 首选项 > Java > 代码生成 > 代码和注释
 */
package com.vanda.report.dp;

import java.util.List;

import com.vanda.report.ReportException;
import com.vanda.report.ReportInnerData;
import com.vanda.report.Validation;
import com.vanda.report.element.Element;

/**
 * @author wkf5985
 *
 * 更改所生成类型注释的模板为
 * 窗口 > 首选项 > Java > 代码生成 > 代码和注释
 */
public class WriteElement extends AggregationElement{
	private String message = null;
	
	public void validator() throws ReportException{
		Validation.checkRequired("WriteElement","field",super.getField());
		Validation.checkRequired("WriteElement","message",message);
	}
	
	/* 
	 * 对新增行写入常量数据
	 * @see com.vanda.report.dp.AggregationElement#aggregate(java.util.List, int, int, java.lang.String[])
	 */
	public Object[] aggregate(
		List beanList,
		int start,
		int end,
		String[] property)
		throws ReportException {
		
		Object[] objs = new Object[1];
		objs[0] = message;

		return objs;
	}

	/**
	 * @return
	 */
	public String getMessage() {
		return message;
	}


	/**
	 * @param string
	 */
	public void setMessage(String string) {
		message = string;
	}

}
